|
The Fredkin gate (also CSWAP gate) is a computational circuit suitable for reversible computing, invented by Ed Fredkin. It is ''universal'', which means that any logical or arithmetic operation can be constructed entirely of Fredkin gates. The Fredkin gate is the three-bit gate that swaps the last two bits if the first bit is 1. == Definition == The basic Fredkin gate〔Brown, Julian, (The Quest for the Quantum Computer ), New York : Touchstone, 2000.〕 is a controlled swap gate that maps three inputs (''C'', ''I''1, ''I''2) onto three outputs (''C'', ''O''1, ''O''2). The ''C'' input is mapped directly to the ''C'' output. If ''C'' = 0, no swap is performed; ''I''1 maps to ''O''1, and ''I''2 maps to ''O''2. Otherwise, the two outputs are swapped so that ''I''1 maps to ''O''2, and ''I''2 maps to ''O''1. It is easy to see that this circuit is reversible, i.e., "undoes" itself when run backwards. A generalized ''n''×''n'' Fredkin gate passes its first ''n''-2 inputs unchanged to the corresponding outputs, and swaps its last two outputs if and only if the first ''n''-2 inputs are all 1. The Fredkin gate is the reversible three-bit gate that swaps the last two bits if the first bit is 1. 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end |} It has the useful property that the numbers of 0s and 1s are conserved throughout, which in the billiard ball model means the same number of balls are output as input. This corresponds nicely to the conservation of mass in physics, and helps to show that the model is not wasteful. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Fredkin gate」の詳細全文を読む スポンサード リンク
|